home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue49 / Factory / FReportListing.pas < prev   
Encoding:
Pascal/Delphi Source File  |  1999-06-16  |  1.7 KB  |  65 lines

  1. {* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  2.   TechInsite Pty. Ltd.
  3.   PO Box 429, Abbotsford, Melbourne. 3067 Australia
  4.   Phone: +61 3 9419 6456
  5.   Fax:   +61 3 9419 1682
  6.   Web:   www.techinsite.com.au
  7.   EMail: peter_hinrichsen@techinsite.com.au
  8.  
  9.   Created: 01/06/1999
  10.  
  11.   Notes: Concrete report for factory demo
  12.  
  13. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
  14. unit FReportListing;
  15.  
  16. interface
  17.  
  18. uses
  19.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  20.   FReportAbstract, StdCtrls, Buttons;
  21.  
  22. type
  23.   TFormReportListing = class(TFormReportAbstract)
  24.   private
  25.     { Private declarations }
  26.   public
  27.     { Public declarations }
  28.     procedure Execute; override ;
  29.   end;
  30.  
  31. implementation
  32. uses
  33.    FactoryReport
  34.   ,FactoryConcreteReport 
  35.   ,Constants
  36.   ;
  37.  
  38. {$R *.DFM}
  39.  
  40. //----------------------------------------------------------
  41. procedure TFormReportListing.Execute;
  42. begin
  43.   Caption := cgStrReportNameListing ;
  44.   MemoReport.Lines.Add( 'A demonstration of the ' +
  45.                         cgStrReportNameListing + ' report.' ) ;
  46.   inherited ;
  47. end;
  48.  
  49. initialization
  50.   // Register report with the simple factory
  51.   gFactoryReport.RegisterReport( cgStrReportNameListing,
  52.                                  TFormReportListing ) ;
  53.  
  54.   // Registering a report twice like this would cause
  55.   // an error.
  56.   // gFactoryReport.RegisterReport( cgStrReportNameListing,
  57.   //                                TFormReportListing ) ;
  58.  
  59.   // Register report with the abstract / concrete factory
  60.   gFactoryConcreteReport.RegisterClass( cgStrReportNameListing,
  61.                                          TFormReportListing ) ;
  62.  
  63. end.
  64.  
  65.